package cn.itsource.pethome.Basic.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 返回结果success/msg封装
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Boolean success=true;
    private String msg;
    //返回到前端数据
    private Object result;

    /**
     * 返回前端数据set方法
     * @param result
     * @return
     */
    public AjaxResult setResult(Object result){
        this.result = result;
        return this;
    }

    public AjaxResult(Boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }
}
